<script>
$("#signForm").ajaxForm({
	dataType:  'json',
	success:  function(data){
	if (data.success) {
		$("#select-subject").trigger('change');
    }
    else {
	  var message = '';
	   $.each(data.message,function(i,val){
        $("#"+i).addClass('ui-state-error');
            $.each(val,function(ii,vv){
            message += $("#"+i+"-label label").html()+': '+ vv+ "\n";
              });
        });
	    jAlert(message, '<?php echo $this->translate('checking errors')?>');
    }
	}
});

$(document).ready(function(){
	$("#cancelBtn").click(function(){

	    $("#append-area").hide();
		});

});
</script>

<form action="<?php echo $this->route('save')?>" method="post" id="signForm">
<?php echo $this->form->group_name?>
<?php echo $this->form->teacher_course_sn?>
<?php echo $this->form->member?>
<input type="hidden" name="subject_sn" value="<?php echo $this->subject_sn?>" />
<?php if ($this->editSn):?>
<input type="hidden" name="sn"  id="sn" value="<?php echo $this->editSn?>" />
<?php endif;?>
<input type="submit"  value="<?php echo $this->translate('send')?>"/>
<input type="button"  id="cancelBtn" value="<?php echo $this->translate('cancel')?>" />
</form>